package com.atguigu.controller;

import com.atguigu.pojo.Employee;
import com.atguigu.service.EmployeeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: liuaojun
 * @CreateTime: 2025-02-07
 * @Description:
 * @Version: 1.0
 */
@Slf4j
@RestController
public class EmployeeController {
    @Autowired
    private EmployeeService employeeService;

    @GetMapping("/emp/{eid}")
    public Employee getEmployee(@PathVariable("eid") Long eid) {
        Employee employee = employeeService.getEmployeeById(1L);
        log.info("controller结果："+employee);
        return employee;
    }
}
